< Prev(J) / Next(K) > / View :

Filename: /text/sbasic/shared/03020403.xhp

(section: curdir) (bookmark: bm_id3153126)
CurDir function

CurDir 関数

CurDir Function [Runtime]
CurDir 関数 [実行時](hd_id3153126.1)

Returns a variant string that represents the current path of the specified drive.
指定ドライブの現在のパスを示す文字列を返します。(par_id3156343.2)

(/section: curdir)

(embed text/sbasic/shared/03020401.xhp#i30692 : linkinfo)

Warning Icon 警告マーク This runtime statement currently does not work as documented. See this issue for more information.
この実行時ステートメントは、現在、ドキュメントどおりに機能しません。詳細は、この課題の説明 を参照してください。(par_id9783013.)

(/embed text/sbasic/shared/03020401.xhp#i30692)

Syntax:
構文:(hd_id3149457.3)

CurDir [(Text As String)]
CurDir [(Text As String)] (par_id3153381.4)

Return value:
戻り値:(hd_id3154366.5)

String
文字列(par_id3156281.6)

Parameters:
パラメータ:(hd_id3156423.7)

Text: Any string expression that specifies an existing drive (for example, "C" for the first partition of the first hard drive).
Text: 既存のドライブを示す文字列表式 (たとえば 1 番目のドライブの第 1 パーティションを指定するには「C」とします)。(par_id3153193.8)

If no drive is specified or if the drive is a zero-length string (""), CurDir returns the path for the current drive. Office Basic reports an error if the syntax of the drive description is incorrect, the drive does not exist, or if the drive letter occurs after the letter defined in the CONFIG.SYS with the Lastdrive statement.
ドライブを指定しないか文字長ゼロの空白文字列を指定した場合 ("")、CurDir は現在のドライブのパスを返します。 有効なドライブ指定でない場合、ドライブが存在しない場合、CONFIG.SYS の Lastdrive ステートメントによる設定値を超えたドライブレターの場合、Office Basic はエラーを報告します。 (par_id3155133.9)

This function is not case-sensitive.
この関数の引数では、大文字と小文字は区別されません。(par_id3150010.10)

(embed text/sbasic/shared/00000003.xhp#errorcode : linkinfo)

Error Codes

エラーコード(hd_id3152869.37)

(/embed text/sbasic/shared/00000003.xhp#errorcode)

(embed text/sbasic/shared/00000003.xhp#err5 : linkinfo)

5 Invalid procedure call
5 無効なプロシージャー呼び出しです (par_id3150891.41)

(/embed text/sbasic/shared/00000003.xhp#err5)

(embed text/sbasic/shared/00000003.xhp#err68 : linkinfo)

68 Device not available
68 デバイスが使用できません (par_id3146818.69)

(/embed text/sbasic/shared/00000003.xhp#err68)

(embed text/sbasic/shared/00000003.xhp#err7 : linkinfo)

7 Out of memory
7 メモリ不足です (par_id3154649.43)

(/embed text/sbasic/shared/00000003.xhp#err7)

(embed text/sbasic/shared/00000003.xhp#err51 : linkinfo)

51 Internal error
51 内部エラーが発生しました (par_id3153957.57)

(/embed text/sbasic/shared/00000003.xhp#err51)

Example:
例:(hd_id3155411.11)

Sub ExampleCurDir
Sub ExampleCurDir(par_id3151113.12)

Dim sDir1 as String , sDir2 as String
Dim sDir1 as String , sDir2 as String(par_id3155306.13)

sDir1 = "c:\Test"
sDir1 = "c:\Test"(par_id3156444.14)

sDir2 = "d:\private"
sDir2 = "d:\private"(par_id3147318.15)

ChDir( sDir1 )
ChDir( sDir1 )(par_id3154013.16)

msgbox CurDir
msgbox CurDir(par_id3153877.17)

ChDir( sDir2 )
ChDir( sDir2 )(par_id3144764.18)

msgbox CurDir
msgbox CurDir(par_id3147125.19)

end sub
end sub(par_id3149581.20)


< Prev / Next >